package tk.mybatis.springboot.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.springboot.mapper.YMapper;
import tk.mybatis.springboot.spider.entity.ErrorEntity;
import tk.mybatis.springboot.spider.entity.ImgsEntity;
import tk.mybatis.springboot.spider.entity.ImowProductEntity;
import tk.mybatis.springboot.spider.entity.ProductEntity;

import java.util.List;

/**
 * Created by xlp on 2017/3/13.
 */
@Service
public class YService {
    @Autowired
    private YMapper yMapper;

    /**
     * 工控猫
     */
    public Boolean saveGkm(ProductEntity productEntity) {
        return yMapper.insertGkm(productEntity);
    }

    public Boolean saveImow(ImowProductEntity productEntity) {
        return yMapper.insertImow(productEntity);
    }

    public List<String> getErrorLink() {
        return yMapper.getErrorLink();
    }

    public boolean deleteErrorLink() {
        return yMapper.deleteErrorLink();
    }

    public boolean setRetry() {
        return yMapper.setRetry();
    }

    /**
     * 保存商品图片
     *
     * @param imgsEntity
     * @return
     */
    public boolean saveProductImg(ImgsEntity imgsEntity) {

        return yMapper.saveProductImg(imgsEntity);
    }

    /**
     * 保存失败的链接
     */
    public boolean saveErrorLink(ErrorEntity errorEntity) {

        return yMapper.saveErrorLink(errorEntity);
    }

}
